QuickTime 4 API Documentation

Inside Macintosh: QuickTime Components

Previous | Overview | Contents

Summary of Image Compressor Components

C Summary

Constants

#define compressorComponentType                 'imco'   /* compressor component type */
#define decompressorComponentType               'imdc'  /* decompressor component type */
enum {
kImageCodecGetCodecInfoSelect                     = 0x0000,
kImageCodecGetCompressionTimeSelect               = 0x0001,
kImageCodecGetMaxCompressionSizeSelect            = 0x0002,
kImageCodecPreCompressSelect                       = 0x0003,
kImageCodecBandCompressSelect                      = 0x0004,
kImageCodecPreDecompressSelect                    = 0x0005,
kImageCodecBandDecompressSelect                   = 0x0006,
kImageCodecBusySelect                              = 0x0007,
kImageCodecGetCompressedImageSizeSelect           = 0x0008,
kImageCodecGetSimilaritySelect                     = 0x0009,
kImageCodecTrimImageSelect                        = 0x000A,
kImageCodecRequestSettingsSelect                   = 0x000B,
kImageCodecGetSettingsSelect                      = 0x000C,
kImageCodecSetSettingsSelect                      = 0x000D,
kImageCodecFlushSelect                             = 0x000E,
kImageCodecSetTimeCodeSelect                       = 0x000F,
kImageCodecIsImageDescriptionEquivalentSelect      = 0x0010,
kImageCodecNewMemorySelect                        = 0x0011,
kImageCodecDisposeMemorySelect                    = 0x0012,
kImageCodecHitTestDataSelect                      = 0x0013,
kImageCodecNewImageBufferMemorySelect              = 0x0014,
kImageCodecExtractAndCombineFieldsSelect          = 0x0015,
kImageCodecGetMaxCompressionSizeWithSourcesSelect = 0x0016,
kImageCodecSetTimeBaseSelect                      = 0x0017,
kImageCodecSourceChangedSelect                    = 0x0018,
kImageCodecFlushFrameSelect                       = 0x0019,
kImageCodecGetSettingsAsTextSelect                 = 0x001A,
kImageCodecGetParameterListHandleSelect           = 0x001B,
kImageCodecGetParameterListSelect                = 0x001C,
kImageCodecCreateStandardParameterDialogSelect   = 0x001D,
kImageCodecIsStandardParameterDialogEventSelect  = 0x001E,
kImageCodecDismissStandardParameterDialogSelect  = 0x001F,
kImageCodecStandardParameterDialogDoActionSelect = 0x0020,
kImageCodecNewImageGWorldSelect                  = 0x0021,
kImageCodecDisposeImageGWorldSelect               = 0x0022,
kImageCodecHitTestDataWithFlagsSelect            = 0x0023,
kImageCodecValidateParametersSelect               = 0x0024,
kImageCodecGetBaseMPWorkFunctionSelect           = 0x0025,
kImageCodecPreflightSelect                        = 0x0200,
kImageCodecInitializeSelect                      = 0x0201,
kImageCodecBeginBandSelect                        = 0x0202,
kImageCodecDrawBandSelect                         = 0x0203,
kImageCodecEndBandSelect                         = 0x0204,
kImageCodecQueueStartingSelect                    = 0x0205,
kImageCodecQueueStoppingSelect                    = 0x0206,
kImageCodecDroppingFrameSelect                   = 0x0207,
kImageCodecScheduleFrameSelect                    = 0x0208,
kImageCodecCancelTriggerSelect                    = 0x0209
};/* image compressor component capabilities flags */
#define codecCanScale                       (1L<<0)     /* decompressor scales
                                                            information */
#define codecCanMask                        (1L<<1)     /* decompressor applies mask to
                                                            image */
#define codecCanMatte                       (1L<<2)     /* decompressor blends image using
                                                            matte */
#define codecCanTransform                   (1L<<3)     /* decompressor works with complex
                                                            placement matrices */
#define codecCanTransferMode                (1L<<4)     /* decompressor accepts transfer
                                                            mode */
#define codecCanCopyPrev                    (1L<<5)     /* compressor updates previous
                                                            image buffer */
#define codecCanSpool                       (1L<<6)     /* component can use functions to
                                                            spool data */
#define codecCanClipVertical                (1L<<7)     /* decompressor clips image
                                                            vertically */
#define codecCanClipRectangular             (1L<<8)     /* decompressor clips image
                                                            vertically & horizontally */
#define codecCanRemapColor                  (1L<<9)     /* compressor remaps color */
#define codecCanFastDither                  (1L<<10)    /* compressor supports fast
                                                            dithering */
#define codecCanSrcExtract                  (1L<<11)    /* compressor extracts portion
                                                            of source image */
#define codecCanCopyPrevComp                (1L<<12)    /* compressor updates previous
                                                            image buffer */
#define codecCanAsync                       (1L<<13)    /* component can work
                                                            asynchronously */
#definecodecCanMakeMask                     (1L<<14)    /* decompressor makes
                                                            modification masks */
#define codecCanShift                       (1L<<15)    /* component works with pixels
                                                            that are not byte-aligned */
/* compressor component condition flags passed to component in
    ImageCodecBandDecompress and ImageCodecPreDecompress functions indicate changes */
#define codecConditionFirstBand                     (1L<<0)     /* (input) first band
                                                                    in frame */
#define codecConditionLastBand                      (1L<<1)     /* (input) last band
                                                                    in frame */
#define codecConditionFirstFrame                    (1L<<2)     /* (input) first frame to be
                                                                     decompressed in this
                                                                     sequence */
#define codecConditionNewDepth                      (1L<<3)     /* (input) depth of
                                                                     destination */
#define codecConditionNewTransform                  (1L<<4)     /* (input) transformation
                                                                     matrix has changed */
#define codecConditionNewSrcRect                    (1L<<5)     /* (input) source rectangle */
#define codecConditionNewMask                       (1L<<6)     /* (input) mask bitmap has
                                                                     changed */
#define codecConditionNewMatte                      (1L<<7)     /* (input) matte pixel map */
#define codecConditionNewTransferMode               (1L<<8)     /* (input) transfer mode */
#define codecConditionNewClut                       (1L<<9)     /* (input) color lookup
                                                                     table */
#define codecConditionNewAccuracy                   (1L<<10)    /* accuracy parameter has
                                                                    changed */
#define codecConditionNewDestination                (1L<<11)    /*(input) destination pixel
                                                                    map */
#define codecConditionCodecChangedMask              (1L<<31)    /* (output) component has
                                                                    changed mask bits */
/* compressor and decompressor flag bits */
#define codecInfoDoes1                      (1L<<0)     /* works with 1-bit pixel maps */
#define codecInfoDoes2                      (1L<<1)     /* works with 2-bit pixel maps */
#define codecInfoDoes4                      (1L<<2)     /* works with 4-bit pixel maps */
#define codecInfoDoes8                      (1L<<3)     /* works with 8-bit pixel maps */
#define codecInfoDoes16                     (1L<<4)     /* works with 16-bit pixel maps */
#define codecInfoDoes32                     (1L<<5)     /* works with 32-bit pixel maps */
#define codecInfoDoesDither                 (1L<<6)     /* supports fast dithering */
#define codecInfoDoesStretch                (1L<<7)     /* stretches to arbitrary sizes */
#define codecInfoDoesShrink                 (1L<<8)     /* shrinks to arbitrary sizes */#define codecInfoDoesMask
(1L<<9)     /* handles clipping regions */
#define codecInfoDoesTemporal               (1L<<10)    /* sequential temporal
                                                            compression */
#define codecInfoDoesDouble                 (1L<<11)    /* stretches to double size
                                                            exactly */
#define codecInfoDoesQuad                   (1L<<12)    /* stretches to quadruple size */
#define codecInfoDoesHalf                   (1L<<13)    /* shrinks to half size */
#define codecInfoDoesQuarter                (1L<<14)    /* shrinks to one quarter size */
#define codecInfoDoesRotate                 (1L<<15)    /* rotates during decompression */
#define codecInfoDoesHorizFlip              (1L<<16)    /* flips horizontally during
                                                            decompression */
#define codecInfoDoesVertFlip               (1L<<17)    /* flips vertically during
                                                            decompression */
#define codecInfoDoesSkew                   (1L<<18)    /* skews image during
                                                            decompression */
#define codecInfoDoesBlend                  (1L<<19)    /* blends image with matte during
                                                            decompression */
#define codecInfoDoesWarp                   (1L<<20)    /* warps image arbitrarily during
                                                            decompression */
#define codecInfoDoesRecompress             (1L<<21) /* recompresses images without
                                                            accumulating errors */
#define codecInfoDoesSpool                  (1L<<22) /*     uses data-loading or
                                                            data-unloading function */
#define codecInfoDoesRateConstrain
                                            (1L<<23)    /* constrains amount of generated
                                                            data to caller-defined limit */
/* compressor and decompressor format flag bits */
#define codecInfoDepth1 (1L<<0)             /* compressed images with 1-bit
                                                color depth available */
#define codecInfoDepth2 (1L<<1)             /* compressed images with 2-bit
                                                color depth available */
#define codecInfoDepth4 (1L<<2)             /* compressed images with 4-bit
                                                color depth available */
#define codecInfoDepth8 (1L<<3)             /* compressed images with 8-bit
                                                color depth available */
#define codecInfoDepth16(1L<<4)             /* compressed images with 16-bit
                                                color depth available */
#define codecInfoDepth32(1L<<5)             /* compressed images with 32-bit
                                                color depth available */
#define codecInfoDepth24(1L<<6)             /* compressed images with 24-bit
                                                color depth available */
#define codecInfoDepth33(1L<<7)             /* compressed data with monochrome images of
                                                1-bit color depth */
#define codecInfoDepth34(1L<<8)             /* compressed images with
                                                2-bit grayscale depth available */
#define codecInfoDepth36(1L<<9)             /* compressed images with 4-bit grayscale
                                                depth available */
#define codecInfoDepth40(1L<<10)         /* compressed images with 8-bit grayscale
                                                depth available */
#define codecInfoStoresClut
                                (1L<<11)    /* compressed data with custom color
                                                tables */
#define     codecInfoDoesLossless
                                (1L<<12)    /* compressed data stored lossless format */
#define     codecInfoSequenceSensitive
                                (1L<<13) /* compressed data requires non-key frames
                                                to be compressed in same order as
                                                compressed */

Data Types

typedef struct {
    long                flags;                  /* control information */
    short               wantedPixelSize;        /* pixel depth for component to use
                                                    with image */
    short               extendWidth;            /* extension width of image in pixels */
    short               extendHeight;           /* extension height of image in pixels */
    short               bandMin;                /* supported minimum image band height */
    short               bandInc;                /* common factor of supported band
                                                    heights */
    short               pad;                    /* reserved */
    unsigned long       time;                   /* milliseconds operation takes to
                                                    complete */
} CodecCapabilities;
typedef CodecCapabilities *CodecCapabilitiesPtr;
typedef struct {
    ImageSequence                   sequenceID;                 /* sequence identifier ID
                                                                    (precompress or
                                                                    bandcompress) */
    ImageDescriptionHandle          imageDescription;           /* handle to image
                                                                    description structure
                                                                    (precompress or
                                                                     bandcompress) */
    Ptr                             data;                       /* location for receipt of
                                                                    compressed image data */
    long                            bufferSize;                 /* size of buffer for data */
    long                            frameNumber;                /* frame identifier */
    long                            startLine;                  /* starting line for band */
    long                            stopLine;                   /* ending line for band */
    long                            conditionFlags;             /* condition flags */
    CodecFlags                      callerFlags;                /* control info flags */
    CodecCapabilities               *capabilities;              /* pointer to compressor
                                                                    capability structure */
    ProgressProcRecord              progressProcRecord;         /* progress function
                                                                    structure */
    CompletionProcRecord            completionProcRecord;       /* completion function
                                                                    structure */
    FlushProcRecord                 flushProcRecord;            /* data-unloading function
                                                                    structure */
    PixMap                          srcPixMap;                  /* pointer to image
                                                                    (precompress or
                                                                     bandcompress) */
    PixMap                          prevPixMap;                 /*  pointer to pixel map
                                                                    for previous image */
    CodecQ                          spatialQuality;             /*  compressed image
                                                                    quality */
    CodecQ                          temporalQuality;            /* sequence temporal
                                                                    quality */
    Fixed                           similarity;                 /* similarity between
                                                                    adjacent frames */
    DataRateParamsPtr               dataRateParams;             /* pointer to the data rate
                                                                    parameters structure */
    long                            reserved;                   /* reserved */
} CodecCompressParams;
typedef CodecCompressParams *CodecCompressParamsPtr;
typedef struct {
    ImageSequence                   sequenceID;                 /* unique sequence ID
                                                                    (predecompress,
                                                                    band decompress) */
    ImageDescriptionHandle          imageDescription;           /* handle to image
                                                                    description structure
                                                                    (predecompress,
                                                                    band decompress) */
    Ptr                             data;                       /* compressed image data */
    long                            bufferSize;                 /* size of data buffer */
    long                            frameNumber;                /* frame identifier */
    long                            startLine;                  /* starting line for band */
    long                            stopLine;                   /* ending line for band */
    long                            conditionFlags;             /* condition flags */
    CodecFlags                      callerFlags;                /* control flags */
    CodecCapabilities               *capabilities;              /* pointer to compressor
                                                                    capability structure
                                                                    (predecompress,
                                                                    band decompress) */
    ProgressProcRecord              progressProcRecord;         /* progress function
                                                                    structure */
    CompletionProcRecord            completionProcRecord;/* completion function
                                                                    structure */
    DataProcRecord                  dataProcRecord;             /* data-loading function
                                                                    structure */
    CGrafPtr                        port;                       /* pointer to color
                                                                    graphics port for image
                                                                    (predecompress,
                                                                    band decompress) */
    PixMap                          dstPixMap;                  /* destination pixel map
                                                                    (predecompress,
                                                                     band decompress) */
    BitMapPtr                       maskBits;                   /* update mask */
    PixMapPtr                       mattePixMap;                /* blend matte pixel map */
    Rect                            srcRect;                    /* source rectangle
                                                                    (predecompress,
                                                                     band decompress) */
    MatrixRecord                    *matrix;                    /* pointer to matrix
                                                                    structure
                                                                    (predecompress,
                                                                     band decompress) */
    CodecQ                          accuracy;                   /* desired accuracy
                                                                    (predecompress,
                                                                     band decompress) */
    short                           transferMode;               /* transfer mode
                                                                    (predecompress,
                                                                     band decompress) */
    long                            reserved[2];                /* reserved */
} CodecDecompressParams;

typedef CodecDecompressParams *CodecDecompressParamsPtr;
/* progress function structure */
typedef struct ProgressProcRecord ProgressProcRecord;                   
typedef ProgressProcRecord *ProgressProcRecordPtr;
struct ProgressProcRecord {
        ProgressProcPtr progressProc;           /* pointer to your progress function */
        long progressRefCon;                    /* reference constant for use by
                                                    your progress function */
};

/* completion function structure */
typedef struct CompletionProcRecord CompletionProcRecord;
typedef CompletionProcRecord *CompletionProcRecordPtr;

struct CompletionProcRecord {
        CompletionProcPtr completionProc;           /* pointer to completion function */
        long completionRefCon;                      /* reference constant used by
                                                        completion function */
};

/* data-loading structure */
typedef struct DataProcRecord DataProcRecord;
typedef DataProcRecord *DataProcRecordPtr;

struct DataProcRecord {
        DataProcPtr dataProc;                       /* pointer to data-loading function */
        long dataRefCon;                            /* reference constant used by
                                                        data-loading function */
};

/* data-unloading structure */
typedef struct FlushProcRecord FlushProcRecord;
typedef FlushProcRecord *FlushProcRecordPtr;
struct FlushProcRecord {
        FlushProcPtr flushProc;         /* pointer to data-unloading function */
        long flushRefCon;               /* reference constant used by data-unloading
                                            function */
};

Functions

Direct Functions

pascal ComponentResult ImageCodecGetCodecInfo
(ComponentInstance ci, CodecInfo *info);
pascal ComponentResult ImageCodecGetMaxCompressionSize
(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
pascal ComponentResult ImageCodecGetCompressionTime
(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
pascal ComponentResult ImageCodecGetSimilarity
(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
pascal ComponentResult ImageCodecGetCompressedImageSize
(ComponentInstance ci, ImageDescriptionHandle desc, Ptr data, long bufferSize, DataProcRecordPtr dataProc, long *dataSize);
pascal ComponentResult ImageCodecTrimImage
(ComponentInstance ci, ImageDescriptionHandle desc, Ptr inData, long inBufferSize, DataProcRecordPtr dataProc, Ptr outData, long outBufferSize, FlushProcRecordPtr flushProc, Rect *trimRect, ProgressProcRecordPtr progressProc);
pascal ComponentResult ImageCodecCodecBusy
(ImageSequence seq);

Indirect Functions

pascal ComponentResult ImageCodecPreCompress
(ComponentInstance ci, CodecCompressParams *params);
pascal ComponentResult ImageCodecBandCompress
(ComponentInstance ci, CodecCompressParams *params);
pascal ComponentResult ImageCodecPreDecompress
(ComponentInstance ci, CodecDecompressParams *params);
pascal ComponentResult ImageCodec BandDecompress
( ComponentInstance ci, CodecDecompressParams *params);

Image Compression Manager Utility Functions

pascal OSErr SetImageDescriptionExtension
(ImageDescriptionHandle desc, Handle extension, long idType);
pascal OSErr GetImageDescriptionExtension
(ImageDescriptionHandle desc, Handle *extension, long idType, long index);
pascal OSErr RemoveImageDescriptionExtension
(ImageDescriptionHandle desc, long type, long index);
pascal OSErr CountImageDescriptionExtensionType
(ImageDescriptionHandle desc, long type, long *count);
pascal OSErr GetNextImageDescriptionExtensionType
(ImageDescriptionHandle desc, long *type);

Pascal Summary

Constants

CONST
compressorComponentType                 ='imco'; {compressor component type}
decompressorComponentType               ='imdc'; {decompressor component type}

    {selector values}
kImageCodecGetCodecInfoSelect                     = $00
kImageCodecGetCompressionTimeSelect               = $01
kImageCodecGetMaxCompressionSizeSelect            = $02
kImageCodecPreCompressSelect                       = $03
kImageCodecBandCompressSelect                      = $04
kImageCodecPreDecompressSelect                    = $05
kImageCodecBandDecompressSelect                   = $06
kImageCodecBusySelect                              = $07
kImageCodecGetCompressedImageSizeSelect           = $08
kImageCodecGetSimilaritySelect                     = $09
kImageCodecTrimImageSelect                        = $0A
kImageCodecRequestSettingsSelect                   = $0B
kImageCodecGetSettingsSelect                      = $0C
kImageCodecSetSettingsSelect                      = $0D
kImageCodecFlushSelect                             = $0E
kImageCodecSetTimeCodeSelect                       = $0F
kImageCodecIsImageDescriptionEquivalentSelect      = $10
kImageCodecNewMemorySelect                        = $11
kImageCodecDisposeMemorySelect                    = $12
kImageCodecHitTestDataSelect                      = $13
kImageCodecNewImageBufferMemorySelect              = $14
kImageCodecExtractAndCombineFieldsSelect          = $15
kImageCodecGetMaxCompressionSizeWithSourcesSelect = $16
kImageCodecSetTimeBaseSelect                      = $17
kImageCodecSourceChangedSelect                    = $18
kImageCodecFlushFrameSelect                       = $19
kImageCodecGetSettingsAsTextSelect                 = $1A
kImageCodecGetParameterListHandleSelect           = $1B
kImageCodecGetParameterListSelect                = $1C
kImageCodecCreateStandardParameterDialogSelect   = $1D
kImageCodecIsStandardParameterDialogEventSelect  = $1E
kImageCodecDismissStandardParameterDialogSelect  = $1F
kImageCodecStandardParameterDialogDoActionSelect = $20
kImageCodecNewImageGWorldSelect                  = $21
kImageCodecDisposeImageGWorldSelect               = $22
kImageCodecHitTestDataWithFlagsSelect            = $23
kImageCodecValidateParametersSelect               = $24
kImageCodecGetBaseMPWorkFunctionSelect           = $25
kImageCodecPreflightSelect                        = $200
kImageCodecInitializeSelect                      = $201
kImageCodecBeginBandSelect                        = $202
kImageCodecDrawBandSelect                         = $203
kImageCodecEndBandSelect                         = $204
kImageCodecQueueStartingSelect                    = $205
kImageCodecQueueStoppingSelect                    = $206
kImageCodecDroppingFrameSelect                   = $207
kImageCodecScheduleFrameSelect                    = $208
kImageCodecCancelTriggerSelect                    = $209
    {image compressor component capabilities flags}
    codecCanScale                       = $1;       {decompressor scales information}
    codecCanMask                        = $2;       {decompressor applies mask to image}
    codecCanMatte                       = $4;       {decompressor blends using matte}
    codecCanTransform                   = $8;       {decompressor works with complex }
                                                    { placement matrices}
    codecCanTransferMode                = $10;      {decompressor accepts transfer mode}
    codecCanCopyPrev                    = $20;      {compressor updates previous buffer}
    codecCanSpool                       = $40;      {component uses functions to spool }
                                                    { data}
    codecCanClipVertical                = $80;      {decompressor clips vertically}
    codecCanClipRectangular             = $100;     {decompressor clips vertically }
                                                    { & horizontally}
    codecCanRemapColor                  = $200;     {compressor remaps color}
    codecCanFastDither                  = $400;     {compressor does fast dithering}
    codecCanSrcExtract                  = $800;     {compressor extracts portion of }
                                                    { source image}
    codecCanCopyPrevComp                = $1000;    {compressor updates previous buffer}
    codecCanAsync                       = $2000;    {component works asynchronously}
    codecCanMakeMask                    = $4000;    {decompressor makes masks}
    codecCanShift                       = $8000;    {component works with pixels }
                                                    { that are not byte-aligned}
    {condition flags}
    codecConditionFirstBand                     = $1;           {first band in frame}
    codecConditionLastBand                      = $2;           {last band in frame}
    codecConditionFirstFrame                    = $4;           {(input) first frame to be }
                                                                { decompressed in this }
                                                                { sequence}
    codecConditionNewDepth                      = $8;           {(input) depth of }
                                                                { destination}
    codecConditionNewTransform                  = $10;          {(input) transformation }
                                                                { matrix has changed}
    codecConditionNewSrcRect                    = $20;          {(input) source rectange}
    codecConditionNewMask                       = $40;          {(input) mask bitmap }
                                                                { has changed}
    codecConditionNewMatte                      = $80;          {(input) matte pixel map)
    codecConditionNewTransferMode               = $100;         {(input) transfer mode}
    codecConditionNewClut                       = $200;         {(input) color lookup table}
    codecConditionNewAccuracy                   = $400;         {accuracy parameter has }
                                                                { changed}
    codecConditionNewDestination                = $800;         {(input) destination pixel }
                                                                { map}
    codecConditionCodecChangedMask              = $80000000;{changed mask bits}
    {CodecInfo compressFlags and deCompressFlags bits}
    codecInfoDoes1                      = $1;       {works with 1-bit pixel maps}
    codecInfoDoes2                      = $2;       {works with 2-bit pixel maps}
    codecInfoDoes4                      = $4;       {works with 4-bit pixel maps}
    codecInfoDoes8                      = $8;       {works with 8-bit pixel maps}
    codecInfoDoes16                     = $10;      {works with 16-bit pixel maps}
    codecInfoDoes32                     = $20;      {works with 32-bit pixel maps}
    codecInfoDoesDither                 = $40;      {supports fast dithering}
    codecInfoDoesStretch                = $80;      {stretches to arbitrary sizes}
    codecInfoDoesShrink                 = $100;     {shrinks to arbitrary sizes}
    codecInfoDoesMask                   = $200;     {handles clipping regions}
    codecInfoDoesTemporal               = $400;     {sequential temporal }
                                                    { compression}
    codecInfoDoesDouble                 = $800;     {stretches to double size}
    codecInfoDoesQuad                   = $1000;    {stretches to quadruple size}
    codecInfoDoesHalf                   = $2000;    {shrinks to half size}
    codecInfoDoesQuarter                = $4000;    {shrinks to one-quarter size}
    codecInfoDoesRotate                 = $8000;    {rotates during decompression}
    codecInfoDoesHorizFlip              = $10000;{flips horizontally}
    codecInfoDoesVertFlip               = $20000;   {flips vertically}
    codecInfoDoesSkew                   = $40000;   {skews image during }
                                                    { decompression}
    codecInfoDoesBlend                  = $80000;   {blends image with matte }
                                                    { during decompression}
    codecInfoDoesWarp                   = $100000;  {warps image during }
                                                    { decompression}
    codecInfoDoesRecompress             = $200000;  {recompresses images}
    codecInfoDoesSpool                  = $400000;  {uses data-loading }
                                                    { or unloading functions}
    codecInfoDoesRateConstrain          = $800000;{constrains amount of generated }
                                                    { data to caller-defined limit}
    {codecInfo formatFlags bits}
    codecInfoDepth1                     = $1;       {color images with 1-bit color depth}
    codecInfoDepth2                     = $2;       {color images with 2-bit color depth}
    codecInfoDepth4                     = $4;       {color images with 4-bit color depth}
    codecInfoDepth8                     = $8;       {color images with 8-bit color depth}
    codecInfoDepth16                    = $10;      {color images with 16-bit color depth}
    codecInfoDepth32                    = $20;      {color images with 32-bit color depth}
    codecInfoDepth24                    = $40;      {color images with 24-bit color depth}
    codecInfoDepth33                    = $80;      {monochrome images with 1-bit color }
                                                    { depth}
    codecInfoDepth34                    = $100;     {grayscale images with 2-bit }
                                                    { grayscale depth}
    codecInfoDepth36                    = $200;     {grayscale images with 4-bit }
                                                    { grayscale depth}
    codecInfoDepth40                    = $400;     {grayscale images with 8-bit }
                                                    { grayscale depth}
    codecInfoStoresClut                 = $800;     {custom color tables}
    codecInfoDoesLossless               = $1000;    {lossless compression or }
                                                    { decompression operations}
    codecInfoSequenceSensitive = $2000; {compression data requires non-key }
                                                    { frames to be decompressed in same }
                                                    { order as compressed}

Data Types

TYPE    CodecCapabilities =
        RECORD
            flags:                  LongInt;        {control information}
            wantedPixelSize:        Integer;        {pixel depth for component to use }
                                                    { with image}
            extendWidth:            Integer;        {extension width of image}
            extendHeight:           Integer;        {extension height of image}
            bandMin:                Integer;        {supported minimum band height}
            bandInc:                Integer;        {common factor of band heights}
            pad:                    Integer;        {reserved}
            time:                   Integer;        {milliseconds to completion}
        END;
        
        CodecCapabilitiesPtr                        =^CodecCapabilities;
        CodecCompressParams =
        RECORD
            sequenceID:                 ImageSequence;      {sequence identifier ID}
            imageDescription:           ImageDescriptionHandle;
                                                            {handle to image }
                                                            { description record}
            data:                       Ptr;                {location for receipt of }
                                                            { compressed image data}
            bufferSize  :               LongInt;            {size of buffer for data}
            frameNumber:                LongInt;            {frame identifier}
            startLine:                  LongInt;            {starting line for band}
            stopLine:                   LongInt;            {ending line for band}
            conditionFlags:             LongInt;            {condition flags}
            callerFlags:                CodecFlags;         {control information flags}

            capabilities:               CodecCapabilitiesPtr;
                                                            {pointer to compressor }
                                                            { capability record
            progressProcRecord:         ProgressProcRecord;
                                                            {progress function record}
            completionProcRecord:       CompletionProcRecord;
                                                            {completion function }
                                                            { record}
            flushProcRecord:            FlushProcRecord;
                                                            {data-unloading function }
                                                            { record}
            srcPixMap:                  PixMap;             {pointer to image}
            prevPixMap:                 PixMap;             {pointer to pixel map }
                                                            { for previous image}
            spatialQuality:             CodecQ;             {compressed image quality}
            temporalQuality:            CodecQ;             {sequence temporal quality}
            similarity:                 Fixed;              {similarity between }
                                                            { adjacent frames}
            dataRateParams              dataRateParamsPtr;
                                                            {pointer to the data rate }
                                                            { parameters record}
            reserved:                   ARRAY[0..1] OF LongInt;
                                                            {reserved}
    END;

    CodecCompressParamsPtr                      = ^CodecCompressParams;
    CodecDecompressParams =
    RECORD
        sequenceID:                     ImageSequence;      {unique sequence ID}
        imageDescription:               ImageDescriptionHandle;
                                                            {handle to image }  
                                                            { description record}
        data:                           Ptr;                {compressed image data}
        bufferSize:                     LongInt;            {size of data buffer}
        frameNumber:                    LongInt;            {frame identifier}
        startLine:                      LongInt;            {starting line for band}
        stopLine:                       LongInt;            {ending line for band}
        conditionFlags:                 LongInt;            {condition flags}
        callerFlags:                    CodecFlags;         {control flags}
        capabilities:                   CodecCapabilitiesPtr;
                                                            {pointer to compressor }
                                                            { capability record}

        progressProcRecord:             ProgressProcRecord;
                                                            {progress function record}
        completionProcRecord:           CompletionProcRecord;
                                                            {completion function record}
        dataProcRecord:                 DataProcRecord;{data-loading function }
                                                            { record}
        port:                           CGrafPtr;           {pointer to color }
                                                            { grafport for image}
        dstPixMap:                      PixMap;             {destination pixel map}
        maskBits:                       BitMapPtr;          {update mask}
        mattePixMap:                    PixMapPtr;          {blend matte pixel map}
        srcRect:                        Rect;               {source rectangle}
        matrix:                         MatrixRecordPtr;
                                                            {pointer to matrix }
                                                            { structure}
        accuracy:                       CodecQ;             {desired accuracy}
        transferMode:                   Integer;            {transfer mode}
        reserved:                       ARRAY[0..1] OF LongInt;
                                                            {reserved}
    END;
    CodecDecompressParamsPtr                    = ^CodecDecompressParams;

    ProgressProcRecordPtr                       = ^ProgressProcRecord;
    ProgressProcRecord      =
    RECORD
        progressProc:           ProgressProcPtr;        {pointer to progress function}
        progressRefCon:         LongInt;                {progress function }
                                                        { reference constant}
    END;
    
    CompletionProcRecordPtr                         = ^CompletionProcRecord;
    CompletionProcRecord        =
    RECORD
        completionProc:         CompletionProcPtr;{pointer to completion function}
        completionRefCon:       LongInt;                {completion function reference }
                                                        { constant}
    END;
    
    DataProcRecordPtr           = ^DataProcRecord;
    DataProcRecord =
    RECORD
        dataProc:           DataProcPtr;            {pointer to data-loading function}
        dataRefCon:         LongInt;                {data-loading function }
                                                    { reference constant}
        END;
    
    FlushProcRecordPtr          = ^FlushProcRecord;
    FlushProcRecord =
    RECORD
        flushProc:          FlushProcPtr;           {pointer to data-unloading function}
        flushRefCon:        LongInt;                {data-unloading function reference }
                                                    { constant}
    END;

Routines

Direct Functions

FUNCTION ImageCodecGetCodecInfo (ComponentInstance: ci; VAR info: CodecInfo): ComponentResult;
FUNCTION ImageCodecGetMaxCompressionSize
(ComponentInstance: ci; src: PixMapHandle; srcRect: Rect; depth: Integer; quality: CodecQ; VAR size: LongInt): ComponentResult;
FUNCTION ImageCodecGetCompressionTime
(ComponentInstance: ci; src: PixMapHandle; srcRect: Rect; depth: Integer; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LongInt): ComponentResult;
FUNCTION ImageCodecGetSimilarity (ComponentInstance: ci; src: PixMapHandle; srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
FUNCTION ImageCodecGetCompressedImageSize
(ComponentInstance: ci; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LongInt; dataProc: DataProcRecordPtr; VAR dataSize: LongInt): ComponentResult;
FUNCTION ImageCodecTrimImage (ComponentInstance: ci; desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LongInt; dataProc: DataProcRecordPtr; outData: Ptr; outBufferSize: LongInt; flushProc: FlushProcRecordPtr; VAR trimRect: Rect; progressProc: ProgressProcRecordPtr): ComponentResult;
FUNCTION ImageCodecBusy (ComponentInstance: ci; seq: ImageSequence): ComponentResult;

Indirect Functions

FUNCTION ImageCodecPreCompress (ComponentInstance: ci; params: CodecCompressParamsPtr): ComponentResult;
FUNCTION ImageCodecBandCompress (ComponentInstance: ci; params: CodecCompressParamsPtr): ComponentResult;
FUNCTION ImageCodecPreDecompress (ComponentInstance: ci; params: CodecCompressParamsPtr): ComponentResult;
FUNCTION ImageCodecBandDecompress (ComponentInstance: ci; params: CodecCompressParamsPtr): ComponentResult;

Image Compression Manager Utility Functions

FUNCTION SetImageDescriptionExtension
(desc: ImageDescriptionHandle; extension: Handle; idType: LongInt): OSErr;
FUNCTION GetImageDescriptionExtension
(desc: ImageDescriptionHandle; VAR extension: Handle; idType: LongInt; index: LongInt): OSErr;
FUNCTION RemoveImageDescriptionExtension
(desc: ImageDescriptionHandle; idType: LongInt; index: LongInt): OSErr;
FUNCTION CountImageDescriptionExtensionType
(desc: ImageDescriptionHandle; idType: LongInt; VAR count: LongInt): OSErr;
FUNCTION GetNextImageDescriptionExtensionType
(desc: ImageDescriptionHandle; VAR idType: LongInt): OSErr;

Result Codes

codecErr

-8960

General error returned by compressor; can be returned by any function that gets handled by the compressor

noCodecErr

-8961

Image Compression Manager could not find specified error

codecUnimpErr

-8962

Feature not implemented by this compressor

codecSpoolErr

-8966

Error loading or unloading data

codecAbortErr

-8967

Operation aborted by progress function

codecExtensionNotFoundErr

-8971

Requested extension is not in the image description structure

codecOpenErr

-8973

Compressor component could not be opened by the Image Compression Manager


© 1999 Apple Computer, Inc.

Previous | Overview | Contents